# big data - most recent right solution

def calc_bd():

    n, m = list(map(int, input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    max_a = max(a)
    max_b = max(b)
    if max_a == 0:
        return sum(b)+(n-1)*max(b)
    
    ifm = a.index(max_a)
    for i in range(ifm, n):
        if a[i] == max_a:
            ilm = i
    
    nb = sum(a) + (m-1) * max_a
    nu = sum(b) + ifm * b[0] + (ilm - ifm) * max_b + (n-1 - ilm) * b[m-1]
    
    return nb * 1_000_000_000 + nu

print(calc_bd())

# empty string

